Compilation of Non-Linear, Second Order Patterns on S-Expressions
نویسنده
چکیده
Pattern matching is a key concept for rule-based expert systems. Simple pattern interpreters appear in nearly every book on Lisp. Pattern matching is also a useful tool for case analyses as provided by functional languages such as ML or Miranda TM. These two uses are somewhat diierent since functional languages emphasize a discrimination based on types while Lisp, or Plasma, make use of S-expressions or segments of S-expressions within patterns. The paper presents an intermediate language for patterns and its denotational semantics. This reduced language is powerful enough to express boolean composition of patterns as well as segment handling and unbounded pattern repetition. A compiler is then deened which translates patterns into functional code. We discuss some compilation variant as well as the integration of the pattern sub-language into Lisp. These capabilities make pattern matching an useful and eecient tool for a wide class of applicative languages and allow to incorporate into patterns more knowledge about the form or gestalt of the data to be matched. Pattern matching is gaining more and more audience within functional languages. Pattern matching is used to deene functions, or just expressions, that perform case analyses. First introduced in NPL Burstall 69] and SASL Turner 76], then in ML Weis 89] or Haskell Hudak & Wadler 90] case construct is an archetypic example of the use of pattern matching within functional languages. Pattern matching is also a key concept in rule-based expert systems and has long been known in the Lisp community. Most textbooks on Lisp Abelson & Sussman 85, Kessler 88, Queinnec 84, Winston 88] contain the description of simple pattern interpreters. The rst pattern compiler was written by Masinter Teitelman 78] and ooered since 1972 as part of the InterLisp programming environment. Pattern matching compares a datum and a pattern. Two eeects are simultaneously involved: check the aspect of the datum, destructure this very datum and extract some of its components. The rst eeect yields a boolean result indicating if the datum matches the pattern i.e.there exists an environment binding pattern variables to data that makes the pattern, with pattern variables substituted by their value in this very environment, equal to the original datum. The second eeect may be considered as a by-product since the destructuration is in fact the precise environment binding pattern variables to parts of the original datum and constructed as part of the matching process. The omnipresent list structure …
منابع مشابه
Kinetic modeling of methylene blue adsorption onto acid-activated spent tea: A comparison between linear and non-linear regression analysis
The kinetic study of methylene blue (MB) adsorption using acid-activated spent tea (AAST) as an adsorbent from aqueous solution with the aim of comparing linear and non-linear regression analysis methods was performed at varying initial MB concentrations (10-100 mg/l). Hence, spent tea leaves, which were activated using concentrated sulfuric acid, were prepared. The physicochemical characterist...
متن کاملNON-STANDARD FINITE DIFFERENCE METHOD FOR NUMERICAL SOLUTION OF SECOND ORDER LINEAR FREDHOLM INTEGRO-DIFFERENTIAL EQUATIONS
In this article we have considered a non-standard finite difference method for the solution of second order Fredholm integro differential equation type initial value problems. The non-standard finite difference method and the composite trapezoidal quadrature method is used to transform the Fredholm integro-differential equation into a system of equations. We have also developed a numerical met...
متن کاملSOME BOUNDARY VALUE PROBLEMS FOR A NON-LINEAR THIRD ORDER O.D.E.
Existence of periodic solutions for non-linear third order autonomous differential equation (O.D.E.) has not been investigated to as large an extent as non-linear second order. The popular Poincare-Bendixon theorem applicable to second order equation is not valid for third order equation (see [3]). This conclusion opens a way for further investigation.
متن کاملOn the second order first zagreb index
Inspired by the chemical applications of higher-order connectivity index (or Randic index), we consider here the higher-order first Zagreb index of a molecular graph. In this paper, we study the linear regression analysis of the second order first Zagreb index with the entropy and acentric factor of an octane isomers. The linear model, based on the second order first Zag...
متن کاملLinear and non-linear regression analysis for the sorption kinetics of methylene blue onto activated carbon.
Batch kinetic experiments were carried out for the sorption of methylene blue onto activated carbon. The experimental kinetics were fitted to the pseudo first-order and pseudo second-order kinetics by linear and a non-linear method. The five different types of Ho pseudo second-order expression have been discussed. A comparison of linear least-squares method and a trial and error non-linear meth...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 1990